package org.dce.screencapturer.objects;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Insets;

import org.dce.screencapturer.util.NumberUtils;

public class ShapeAttributes {

	private TextAttributes textAttributes = new TextAttributes();
	private LineAttributes lineAttributes = new LineAttributes();
	private FillAttributes fillAttributes = new FillAttributes();
	private ShadowAttributes shadowAttributes = new ShadowAttributes();

	public ShapeAttributes(){
	}

	public ShapeAttributes(
		boolean lineEnabled,
		Color lineColor,
		BasicStroke lineStroke,
		boolean fillEnabled,
		Color fillColor,
		FillType fillType){
		
		lineAttributes.setEnabled(lineEnabled);
		lineAttributes.setColor(lineColor);
		fillAttributes.setEnabled(fillEnabled);
		fillAttributes.setColor(fillColor);
		
	}

	public ShadowAttributes getShadowAttributes() {
		return shadowAttributes;
	}
	public void setShadowAttributes(ShadowAttributes shadowAttributes) {
		this.shadowAttributes = shadowAttributes;
	}
	public TextAttributes getTextAttributes() {
		return textAttributes;
	}
	public void setTextAttributes(TextAttributes textAttributes) {
		this.textAttributes = textAttributes;
	}
	public LineAttributes getLineAttributes() {
		return lineAttributes;
	}
	public void setLineAttributes(LineAttributes lineAttributes) {
		this.lineAttributes = lineAttributes;
	}
	public FillAttributes getFillAttributes() {
		return fillAttributes;
	}
	public void setFillAttributes(FillAttributes fillAttributes) {
		this.fillAttributes = fillAttributes;
	}
	public Insets getInsets(){
		
		Insets i1 = shadowAttributes.getInsets();
		Insets i2 = shadowAttributes.getInsets();
		Insets i3 = shadowAttributes.getInsets();
		Insets i4 = shadowAttributes.getInsets();
		
		return new Insets(
			NumberUtils.max(i1.top,i2.top,i3.top,i4.top),
			NumberUtils.max(i1.left,i2.left,i3.left,i4.left),
			NumberUtils.max(i1.bottom,i2.bottom,i3.bottom,i4.bottom),
			NumberUtils.max(i1.right,i2.right,i3.right,i4.right));
	}
}
